<template>
    <div>
        <table width="800" border="1" cellspacing="0">
            <thead>
                <tr>
                    <th>#</th>
                    <th>姓名</th>
                    <th>年龄</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <tr v-for="(item,index) in fat" :key="index">
                    <th>{{index}}</th>
                    <th>{{item.name}}</th>
                    <th>{{item.age}}</th>
                    <th>
                        <button @click="del(index)">删除</button>
                    </th>
                </tr>
            </tbody>
        </table>
    </div>
</template>

<script>

export default {
    props: ['fat'],
    methods: {
        del(i) {
            this.fat.splice(i,1)
        }
    },
}
</script>

<style lang="scss" >

</style>